import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
import Login from '@/views/login'
import Register from '@/views/register'
import Layout from '@/components/Layout'
import Home from '@/views/home'
import TopicInfo from '@/views/topicinfo'
import MyInfo from '@/views/myinfo'

export default new VueRouter({
  routes: [
    { path: '/login', component: Login },
    { path: '/register', component: Register },
    {
      path: '/',
      component: Layout,
      redirect: '/home',
      children: [
        {
          path: '/home',
          component: Home
        },

      ]
    },
    {
      path: '/topicinfo', 
      component: Layout,
      children:[
        {
          path:'/',
          name:'topicinfo',
          component:TopicInfo
       }

      ]
    },
    {
      path: '/myinfo', 
      component: Layout,
      children:[
        {
          path:'/',
          component:MyInfo
       }

      ]
    },
  ]
})